package com.jielihaofeng.nettyadvance.rpc.message;

import lombok.Data;
import lombok.ToString;

/**
 * @author Johnnie Wind
 * @description RPC响应消息
 * @date 2021/11/19 14:18
 */
@Data
@ToString(callSuper = true)
public class RpcResponseMessage extends Message{

    // 返回值
    private Object returnValue;

    // 异常值
    private Exception exceptionValue;

    public RpcResponseMessage() {
    }

    public RpcResponseMessage(Object returnValue, Exception exceptionValue) {
        this.returnValue = returnValue;
        this.exceptionValue = exceptionValue;
    }

    @Override
    public int getMessageType() {
        return RPC_MESSAGE_TYPE_RESPONSE;
    }
}
